set more off
capture log close
cd *** Fill in path name here ***

//  program:    AnanatEtAl_suicidality results
//  task:		Regressions of suicidal ideation on job loss -- for years prior to Great Recession

log using *** Fill in file name here ***, replace text

// Run this sensitivity check for black youth only 

// #1
// Load data
use AnanatEtAl_suicidality_data.dta, clear

keep if year < 2008 & black == 1

// #2
// Indicate data is weighted
svyset psu [pweight=weight], strata(stratum)  singleunit(certainty) 

// #3 
// Run IV-probit regressions, addressing the complex survey design, black youth only

svy: ivprobit suicthtly (seppctyrlag = ticpctyrlag) age female yrd* std*
margins, dydx (seppctyrlag) predict (pr)

clear

log close
